<!--部门管理模板-->
<div class="bg-light lter b-b wrapper-sm">
    <h1 class="m-n font-thin h4">部门管理</h1>
</div>
<div class="wrapper-sm" ng-controller="departmentManagentController">
    <div class="panel panel-default">
        <div class="panel-heading font-bold">查询</div>
        <div class="panel-body">
            <label class="control-label pull-left m-t-xs">部门名称</label>
            <div class="col-md-2">
                <input type="text" class="form-control input-sm" id="table_departmentManagent_name" name="name" ng-model="queryTerms.name" placeholder="请输入部门名称">
            </div>
            <div class="col-md-2">
                <button id="table_departmentManagent_queryFunc" ng-click="queryFunc()" class="btn btn-sm btn-default btn-addon" ng-class="{'disabled':querying}" ng-disabled="querying">
                        <i class="fa fa-search" ng-show="!querying"></i>
                        <i class="fa fa-spinner no-bordr" ng-show="querying" ng-class="{'fa-spin':querying}"></i>
                        <span ng-show="!querying">查询</span>
                        <span ng-show="querying">查询中...</span>
				</button>
            </div>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            部门列表
        </div>
        <div class="table-responsive">
            <div ui-grid="gridOptions" ui-grid-pagination ui-grid-auto-resize ui-grid-resize-columns style="height:{{heightA}}px; min-height:396px; overflow:hidden; min-width:1000px;">
                <div class="watermark" ng-if="!gridOptions.data.length">暂无数据</div>
            </div>
        </div>
        <div class="panel-body">
            <button id="table_departmentManagent_addDepartment" class="pull-right-xs btn btn-sm m-b-xs btn-info btn-addon " ng-click="addDepartment()" data-toggle="modal" data-target="#myModal">
				<i class="fa fa-plus"></i>添加
			</button>
        </div>
    </div>

    <!-- 添加/编辑对话框 -->
    <div class="modal fade bs-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" data-backdrop="static">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button id="table_departmentManagent_detail_close" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">{{title}}</h4>
                </div>
                <form class="form-horizontal form-validation" id="departForm" novalidate>
                    <div class="modal-body">
                        <div class="form-group">
                            <label class="col-lg-4 control-label">部门名称<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input id="table_departmentManagent_detail_name" type="text" class="form-control" ng-model="detail.name" placeholder="请填写部门名称" name="detailName" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <tms-commissioner type-List="detail.types"></tms-commissioner>
                            <!-- <tms-authorization authority-List="detail.roles"></tms-authorization> -->
                        </div>

                    </div>
                    <div class="modal-footer">
                        <button type="button" id="table_departmentManagent_detail_cancel" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" id="table_departmentManagent_detail_click" ng-click="detail.click()">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <!-- 添加/编辑权限对话框 -->
    <div class="modal fade bs-example-modal-lg" id="authModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button id="table_employeeManagent_detail_close" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>

                    <button type="button" id="table_employeeManagent_expandAll" class="btn btn-primary" ng-click="toggleTree()">
							<span ng-if="!treeExpand">全部展开</span><span  ng-if="treeExpand">全部折叠</span>
						</button>

                    <span>&nbsp;&nbsp;&nbsp;{{departmentName}}权限</span>

                </div>
                <form class="form-horizontal form-validation" id="employeeForm" novalidate>
                    <div class="modal-body">
                        <div class="form-group">
                            <!-- <tms-commissioner type-List="detail.types"></tms-commissioner> -->
                            <tms-auth-tree auth-tree="authTree" tree-expand="treeExpand" auth-numbers="authNumbers" save-checked="saveChecked" sec-auth-type-tag="secAuthTypeTag"></tms-uth-tree>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" id="table_employeeManagent_detail_cancel" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" id="table_employeeManagent_detail_click" class="btn btn-primary" ng-click="saveCheckedAuth()">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>